import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:gourmet/extensions/ex_widget.dart';
import 'package:gourmet/utils/colors.dart';
import 'package:gourmet/utils/styles.dart';
import 'package:pretty_qr_code/pretty_qr_code.dart';

class LocalErrandController extends GetxController {}

class LocalErrandPage extends GetView<LocalErrandController> {
  const LocalErrandPage({super.key});

  @override
  Widget build(BuildContext context) {
    return MediaQuery.removeViewPadding(
      context: context,
      removeBottom: true,
      removeLeft: true,
      removeTop: true,
      removeRight: true,
      child: Material(
        child: Container(
          decoration: const BoxDecoration(
            image: DecorationImage(
              image: NetworkImage(
                  'https://cdn7.axureshop.com/demo2024/1877666/images/%E5%90%8C%E5%9F%8E%E8%B7%91%E8%85%BF/u9722.png'),
              fit: BoxFit.fill,
            ),
          ),
          child: Column(
            children: [
              Padding(
                padding: Get.mediaQuery.padding,
                child: Row(
                  children: [
                    Container(
                      width: 40,
                      height: 44,
                      alignment: Alignment.center,
                      child: const Icon(
                        CupertinoIcons.chevron_back,
                        size: 20,
                        color: Colors.white,
                      ),
                    ).onTap(Get.back),
                  ],
                ),
              ),
              Container(
                margin: EdgeInsets.only(top: Get.height * 0.68),
                alignment: Alignment.center,
                child: SizedBox(
                  width: 125,
                  height: 125,
                  child: PrettyQrView.data(
                      decoration: const PrettyQrDecoration(
                        background: Colors.white,
                      ),
                      data: 'data',
                      errorCorrectLevel: QrErrorCorrectLevel.L),
                ),
              ),
              Container(
                margin: const EdgeInsets.only(top: 15),
                alignment: Alignment.center,
                child: Text(
                  '下载同城跑腿APP了解更多',
                  style: StylesUtils.customTextStyle(
                    fontSize: StylesUtils.fontSize13,
                    color: ColorsUtils.color9999,
                  ),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
